<template>
	<w-container class=" plr-16">
		<w-navbar id='my-nav' bg-color="#fff" placeholder title="中签记录"></w-navbar>
		<u-gap height="12"></u-gap>
		<view v-if="list.length" class="br-12">
			<view v-for="(item,index) in list" :key="item.draw_sn" >
				<view class="flex flex-js-sb flex-ai-center">
					<view class="">
						<view class="font-size-14 font-color-black font-w-bold">
							签号:{{item.draw_sn}}
						</view>
						<view class="mt-8 font-size-12 font-color-minor">
							抽签时间:{{item.draw_time|formatDate}}
						</view>
					</view>
					<view v-if="item.draw_time*1000<new Date().getTime()&&item.draw_time">
						<u-tag v-if="item.status==1" text="已中签" size="mini" bgColor="#F44A6C" color="#fff"></u-tag>
						<u-tag v-else text="未中签" borderColor='#F5F5F5' size="mini" bgColor="#F5F5F5" color="#898989"></u-tag>
					</view>
					<u-tag v-else text="未开奖" borderColor='#F5F5F5' size="mini" bgColor="#F5F5F5" color="#898989"></u-tag>
				</view>
				<u-line v-if="( index + 1 != list.length)" margin="24rpx 0"></u-line>
			</view>
		</view>
		<w-loading v-else empty-top="200" type="empty" empty-type="search"></w-loading>
	</w-container>
</template>

<script>
	import {
		drawLog
	} from '@/api/draw/index.js'
	export default {
		data() {
			return {
				id:'',
				list: []
			}
		},
		onLoad({
			id
		}) {
			this.id = id
			this.getList()
		},
		onPullDownRefresh() {
			this.getList()
		},
		methods: {
			getList() {
				drawLog(this.id).then(res => {
					uni.stopPullDownRefresh()
					this.list = res.data;
				})
			}
		}
	}
</script>

<style>
 page {
	 background-color: #fff;
 }
</style>